package com.mb.search.controller;

import com.mb.common.vo.SysResult;
import com.mb.search.service.IndexSercvice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {

    @Autowired
    private IndexSercvice indexSercvice;

    @RequestMapping("/sqhz/index")
    public SysResult doIndex() {
        try {
            indexSercvice.doIndex();
            return SysResult.ok();
        } catch (Exception e) {
            e.printStackTrace();
            SysResult.build(201,"生成索引文件失败",null);
        }

        return null;
    }
}
